home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
Cron 1.0a7.sit
/
Cron Distribution
/
Documentation
/
crontab (example)
< prev
next >
Wrap
Text File
|
1996-05-27
|
3KB
|
86 lines
// Here's an example crontab file, based on some functions I've
// found useful on my own Mac from time to time.
//
//
// QuickRef: The fields of a crontab entry specify the following:
//
// Field Meaning
// ----- ------------------------------------------------------
// 1 Minute (0-59)
// 2 Hour (0-23)
// 3 Day of the month (1-31)
// 4 Month of the year (1-12)
// 5 Day of the week (1-7, with 1=Monday)
// 6 User name (unused)
// 7+ Command name and arguments (if command is preceded by
// "-b" cron executes it in the background).
// We include this line to prove to the first time Cron user that
// Cron actually works.
startup 0 : * * * * * nobody echo "Cron is alive and well."
// Launch the Eudora mailer in the background at 8:40 AM every
// weekday so my mail will be waiting for me when I arrive.
40 8 * * 1-5 nobody -b CSOm
// Get the correct date & time from one of several TCP-based Time
// Protocol servers on the network. Do this at 3:00 every morning.
// Note that MacTCP is required, and the Map control panel must be
// set to the correct local time zone for this to work properly.
//
// Remember to use the -d option if you live in a part of the USA
// that conforms to the Daylight Savings Time (DST) convention.
//
// We select 3:00 AM because the change to/from DST occurs at
// 2:00 AM, and waiting a further hour guarantees that the change
// will be caught in a (relatively) timely manner even if the Mac's
// clock is running as much as an hour fast. Of course, you could
// just call the server a lot more often, but it seems kind of
// pointless.
0 3 * * * nobody -b "udp time client" -ld ntp1.utexas.edu ntp2.utexas.edu hermes.chpc.utexas.edu apple.com nic.ddn.mil
// If the Mac's clock chip loses power for some reason, it will
// revert to Friday, January 1st, 1904, 12:00 AM. We'll anticipate
// that problem by invoking the time client several times during
// the hour of midnight on a January 1st which falls on a Friday.
// We can't test for the year, of course, so we only want to make
// a couple of checks, lest the time servers be flooded with
// requests when the aformentioned criteria are met naturally.
0,2,4,6 0 1 1 5 nobody -b "udp time client" -ld ntp1.utexas.edu ntp2.utexas.edu hermes.chpc.utexas.edu apple.com nic.ddn.mil
// The following lines attempt to reboot my Mac at approximately
// 4 AM every morning, so that it can start the day fresh. The
// redundant shutdown calls will have no effect unless someone in
// the office using my Mac has cancelled one of the previous calls.
// Since all these shutdown calls use the -i (interactive) option,
// the user can conceivably cancel them all and go on working
// uninterrupted, but, hopefully, theyユll get the idea....
//
// The -d option forces the desktops on all mounted volumes (where
// applicable) to be deleted, which causes the Finder to rebuild
// them when the system comes back up. Note that all "Get Info"
// comments are lost when using the -d option, even if you're using
// System 7.5.3 or better.
50 3 * * * nobody shutdown -ird 600 "Please prepare for the nightly system restartノ"
55 3 * * * nobody shutdown -ird 300 "Please prepare for the nightly system restartノ"
58 3 * * * nobody shutdown -ird 120 "Please prepare for the nightly system restartノ"
59 3 * * * nobody shutdown -ird 60 "Please prepare for the nightly system restartノ"